package br.com.veterinariavillage.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class GenericDao {

	private static Connection con;
	
	public static Connection getConnection(){
		String driver = "net.sourceforge.jtds.jdbc.Driver"; 
		String endereco = "jdbc:jtds:sqlserver://localhost:1433;";
		String database = "DatabaseName=VeterinariaVillage;";
		String pipesNomeados = "namedPipe=false"; 
		String usuario = "sa";
		String senha = "fnc123";
		try{
			Class.forName(driver);
			con = DriverManager.getConnection(endereco+database+pipesNomeados,usuario,senha);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e){
			e.printStackTrace();
		} catch (Exception e){
			e.printStackTrace();
		}
		return con;
	}
	
}
